#include <iostream>
using namespace std;

class Counter {
public:
	Counter (int data = 0):m_data(data) {}
	Counter& add (void) {
		++m_data;
		//this指针指向调用对象
		//*this就是调用自身
		return *this;
	}
	void Destory (void) {
		cout << "this = " << this << endl;
		delete this;
	}

	int m_data;
};

int main (void)
{
	Counter cn;
	cn.add().add().add().add().add();

	Counter* pcn = new Counter;
	cout << "pcn = " << pcn << endl;
	pcn -> Destory (); 
	return 0;
}
